package com.jc.cloud.sign.tencent.controller;

import java.util.Arrays;
import java.util.Map;

import com.jc.cloud.sign.common.PageUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.jc.cloud.sign.bean.entity.TbOrgJoinenterpriseEntity;
import com.jc.cloud.sign.service.TbOrgJoinenterpriseService;
import com.jc.cloud.sign.common.R;



/**
 * 员工加入企业通知
 *
 * @author whx
 * @email sunlightcs@gmail.com
 * @date 2023-11-13 22:08:30
 */
@RestController
@RequestMapping("sign/tborgjoinenterprise")
public class TbOrgJoinenterpriseController {
    @Autowired
    private TbOrgJoinenterpriseService tbOrgJoinenterpriseService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    @RequiresPermissions("sign:tborgjoinenterprise:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = tbOrgJoinenterpriseService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    @RequiresPermissions("sign:tborgjoinenterprise:info")
    public R info(@PathVariable("id") Long id){
		TbOrgJoinenterpriseEntity tbOrgJoinenterprise = tbOrgJoinenterpriseService.getById(id);

        return R.ok().put("tbOrgJoinenterprise", tbOrgJoinenterprise);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    @RequiresPermissions("sign:tborgjoinenterprise:save")
    public R save(@RequestBody TbOrgJoinenterpriseEntity tbOrgJoinenterprise){
		tbOrgJoinenterpriseService.save(tbOrgJoinenterprise);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    @RequiresPermissions("sign:tborgjoinenterprise:update")
    public R update(@RequestBody TbOrgJoinenterpriseEntity tbOrgJoinenterprise){
		tbOrgJoinenterpriseService.updateById(tbOrgJoinenterprise);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    @RequiresPermissions("sign:tborgjoinenterprise:delete")
    public R delete(@RequestBody Long[] ids){
		tbOrgJoinenterpriseService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
